	package com.xidian.GMS.controller;

	import java.math.BigDecimal;
import java.text.ParseException;
	import java.text.SimpleDateFormat;
	import java.util.Date;

	import org.springframework.beans.factory.annotation.Autowired;
	import org.springframework.stereotype.Controller;
	import org.springframework.ui.Model;
	import org.springframework.web.bind.annotation.RequestMapping;
	import org.springframework.web.bind.annotation.RequestMethod;


	import com.xidian.GMS.entity.RecruitmentInformation;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xidian.GMS.dto.Page;
import com.xidian.GMS.entity.RecruitmentInformation;

	import com.xidian.GMS.mapper.RecruitmentInformationMapper;
	import com.xidian.GMS.service.RecruitmentInformationService;
	@Controller
public class RecruitmentInformationController {

		@Autowired
		  private RecruitmentInformationMapper RecruitmentInformationMapper;
		@Autowired
		 private RecruitmentInformationService  RecruitmentInformationService;
		@RequestMapping(value="/RecruitmentInformationEdit",method= RequestMethod.GET)
		public String update0(int enterpriseid ,Model  model){
			    model.addAttribute("enterpriseid", enterpriseid);
				return "RecruitmentInformationEdit";
				// TODO: handle exception
			
		}


		@RequestMapping(value="/RecruitmentInformationEdit",method= RequestMethod.POST)
		public String update(RecruitmentInformation recruitmentInformation){	
				RecruitmentInformationService.update(recruitmentInformation);
				return "RecruitmentInformationIndex";
		}

		@RequestMapping(value="/RecruitmentInformationInsert",method= RequestMethod.POST)
		public String Insert(RecruitmentInformation recruitmentInformation) throws ParseException{
		    System.out.println(123);
			    System.out.println(recruitmentInformation);
			try {		
			    RecruitmentInformationService.Insert(recruitmentInformation);
				return "RecruitmentInformationIndex";
			} catch (Exception e) {
				return "RecruitmentInformationInsert";
				// TODO: handle exception
			}
			
		}
		@RequestMapping(value="/RecruitmentInformationInsert",method= RequestMethod.GET)
		public String Insert(){

				return "RecruitmentInformationInsert";
				// TODO: handle exception
			
			
		}
		@RequestMapping(value="/RecruitmentInformation",method= RequestMethod.GET)
		public String Insert22(){

				return "RecruitmentInformation";
				// TODO: handle exception
			
			
		}
		@RequestMapping(value="/RecruitmentInformationDelete",method= RequestMethod.GET)
		public String delete(int enterpriseid){
			try {
			    RecruitmentInformationService.delete(enterpriseid);
				return "forward:/fun5-recruitmentInfo.html";
			} catch (Exception e) {
				return "RecruitmentInformationInsert";
				// TODO: handle exception
			}
			
		}

		@RequestMapping(value="/RecruitmentInformationIndex",method= RequestMethod.POST)
		public String IndexPost(){

				return "RecruitmentInformationIndex";
				// TODO: handle exception
			}
			



		@RequestMapping(value="/RecruitmentInformationIndex",method= RequestMethod.GET)
		@ResponseBody
		public Page index(@RequestParam(name="cur", defaultValue="1") int cur, Model model){
			Page page = RecruitmentInformationService.getRecruitmentInformation(cur);
			System.out.println(page);
		 	model.addAttribute("page", page);

				return page;
				// TODO: handle exception
			
			
		}

			
		}



